package com.yixin.hospital.utils;

import java.util.Random;

/**
 * created by 王福顺  on 2020/10/17
 */
public class SqeUtil {


    private static final Random random = new Random();

    /**
     * [)
     * @param start
     * @param end
     * @return
     */
    public static Integer randomInt(Integer start, Integer end) {
        return random.nextInt(end - start) + start;
    }


    public static Integer getRandomByLength(int length) {
        return randomInt((int) Math.pow(10, length - 1),(int) Math.pow(10, length));
    }

    public static String getMerchantSeq(String preStr) {
        return preStr + getRandomByLength(3) + System.currentTimeMillis();
    }

}
